import store from '@/store'

export const imgerror = {
  inserted: function(el, option) {
    // console.log('el', el)
    // console.log('option', option)
    el.onerror = () => {
      console.log('图片加载失败，给一个默认的地址')
      el.src = option.value
    }
  }
}
export const allow = {
  inserted: function(el, option) {
    // console.log('el', el)
    console.log('option', option)
    const points = store.state.user.uesrInfo.roles.points
    if (!points.includes(option.value)) {
      el.style.display = 'none'
    }
  }
}
